//
//  HamburgerView.swift
//  elarc01
//
//  Created by elarc on 2016/11/7.
//  Copyright © 2016年 elarc. All rights reserved.
//

import Foundation

class HamburgerView: UIView {
    
    var imageView:UIImageView = UIImageView(image:UIImage(named:"mc"))
    override init(frame: CGRect) {
        super.init(frame: frame)
        configView()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func rotate(fraction: CGFloat) {
        let angle = Double(fraction) * M_PI_2
        imageView.transform = CGAffineTransformMakeRotation(CGFloat(angle))
    }
    
    func configView()  {
        imageView.contentMode = UIViewContentMode.Center
        addSubview(imageView)
    }
}